<template>
  <div>
    <!-- <h3>柱状图三</h3> -->
    <div id="getpeo"></div>
  </div>
</template>
<script>
import * as echarts from "echarts";
export default {
  data() {
    return {};
  },
  mounted() {
    this.getpeo();
  },
  methods: {
    getpeo() {
      var chartDom = document.getElementById("getpeo");
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        grid: {
          top: "20%",
          bottom: "20%",
          left: "15%",
          right: "15%",
        },
        xAxis: {
          type: "category",
          axisTick: {
            show: true,
            inside: true,
            length: 175,
            // length: '50%',
            lineStyle: {
              type: "dashed",
              color: "#FFFFFF",
              opacity: 0.6,
            },
            alignWithLabel: true,
          },
          axisLine: {
            lineStyle: {
              color: "#FFFFFF",
              opacity: 0.1,
            },
          },
          axisLabel: {
            fontSize: 16,
            fontFamily: "Source Han Sans CN",
            fontWeight: 400,
            color: "#FFFFFF",
            opacity: 0.8,
            margin: 19, //坐标轴文本距离坐标轴横线距离
          },

          data: ["优秀", "良好", "合格", "不合格"],
        },
        yAxis: {
          type: "value",
          min: 0,
          max: 100,
          splitLine: {
            lineStyle: {
              //包括图表中间的线条样式
              color: "#FFFFFF",
              opacity: 0.1,
            },
          },
          axisLabel: {
            // rotate: 90, // 文本旋转角度
            fontSize: 14,
            fontFamily: "Source Han Sans CN",
            fontWeight: 400,
            margin: 19, //坐标轴文本距离坐标轴横线距离
            color: "#FFFFFF",
            opacity: 0.5,
          },
        },
        series: [
          {
            data: [62, 83, 45, 88],
            // type: "themeRiver",
            type: "pictorialBar",
            barCategoryGap: "60%",
            symbol:
              "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
            // barWidth: 430,
            barWidth: '280%',
            smooth: false,
            itemStyle: {
              normal: {
                barBorderRadius: 0,
                color: {
                  type: "linear",
                  x: 0,
                  y: 0,
                  x2: 0,
                  y2: 1,
                  colorStops: [
                    {
                      offset: 0,
                      color: "#5BFCF4", // 0% 处的颜色
                    },
                    {
                      offset: 1,
                      color: "transparent", // 100% 处的颜色
                    },
                  ],
                  global: false, // 缺省为 false
                },
              },
            },
          },
        ],
      };

      option && myChart.setOption(option);
    },
  },
};
</script>
<style scoped>
#getpeo {
  width: 100%;
  height: 300px;
  background-color: #00222d;
}
</style>